<%@ page contentType="text/html;charset=utf-8"%>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%>
<script language="JavaScript" src="<%= request.getContextPath() + "/js/calendar6.js" %>"></script>
<script language="JavaScript" src="<%= request.getContextPath() + "/js/popUP.js" %>"></script>

<script language="javascript">
    function fsubsecretaria(){    
        document.frmIngresarSubprograma.action ="<%=request.getContextPath()+"/subprogramas/IngresarSubprograma.do"%>"
        document.frmIngresarSubprograma.submit();
    }
</script>

<link href="<%= request.getContextPath() + "/css/bloques.css" %>" rel="stylesheet" type="text/css"/>
<P/>
<P/>
<DIV align="center">
  <table cellspacing="3" cellpadding="3" border="0" width="100%">
    <tr>
      <td>
        <DIV align="center" class="titulosenblanco">Ingresar Informacion del Beneficio</DIV>
      </td>
    </tr>
  </table>
</DIV>
<DIV align="center">
    <form name="frmIngresarSubprograma" method="GET" action="<%=request.getContextPath()+"/subprogramas/GuardarSubprograma.do"%>">
    <input type="hidden" name="admincodigo1"/>
    <table border="0" width="80%" align="center">
        <tr>
            <td class="celdatabla">
              <STRONG>Nombre&nbsp; (*)</STRONG> 
            </td>
            <td>
              <%String strNameSubprog = (String)request.getAttribute("nameSubprog");
                if(strNameSubprog == null)
                    strNameSubprog = "";
              %>
                <!-- <html:text property="subprograma" maxlength="60" value="<%=strNameSubprog%>" styleClass="form"/> -->
            </td>
        </tr>
        <tr>
            <td class="celdatabla">
                <STRONG>Programa&nbsp;al&nbsp;que&nbsp;pertenece&nbsp;(*)</STRONG>&nbsp;
            </td>
            <td>
                <%String strCodeprog = (String)request.getAttribute("codeProg");
                    if(strCodeprog == null)
                        strCodeprog = "1";
                %>
                <logic:iterate length="1" id="prog" name="programas" type="com.cs.beneficios.business.model.ProgramaVO">
                <html:select name="prog" property="codePrograma" value="<%=strCodeprog%>" title="programa" styleClass="form" onchange="fsubsecretaria()">
                    <option value="1">Seleccione un Programa</option>
                    <html:options name="prog" labelProperty="nombre" property="codePrograma" collection="programas"/>
                </html:select>
                </logic:iterate>
            </td>
        </tr>
        <logic:present name="coSubSecret">
        <tr>
            <td class="celdatabla">
              <STRONG>Secretaria</STRONG> 
            </td>
            <td>
                <%String strSecretaria = (String)request.getAttribute("secretaria");%>
                <input type="text" class="form" name="secretaria" readonly="readonly" value="<%=strSecretaria%>" maxlength="60" size="60"/>
            </td>
        </tr>
        <tr>
            <td class="celdatabla">
              <STRONG>Subsecretaria (*)</STRONG>
            </td>
            <td>
              <logic:iterate length="1" id="subsec" name="coSubSecret" type="com.cs.beneficios.business.model.AreaVO">
                <html:select name="subsec" property="codearea" title="subsecretaria" styleClass="form">
                    <html:options name="subsec" labelProperty="nombresubarea" property="codearea" collection="coSubSecret"/>
                </html:select>
              </logic:iterate>
            </td>
        </tr>
        </logic:present>
        
        <tr>
            <td class="celdatabla">
              <STRONG>Descripcion </STRONG>
            </td>
            <td>
              <%  String strDesc = (String)request.getParameter("descripcion");
              strDesc = strDesc.trim();
               if(strDesc == null) strDesc = "";
            %>
              <textarea Class="form" cols="40" rows="5" name="descripcion"  >
                <%=strDesc%>
              </textarea>
            </td>
        </tr>
        
        <tr>
            <td width="29%" class="celdatabla">
              <STRONG>Cada&nbsp;cuanto&nbsp;se&nbsp;entregar&aacute;? &nbsp;(*) &nbsp;&nbsp;&nbsp;</STRONG> 
            </td>
            <td width="51%">
              <%  Object strDias = request.getParameter("dias"); 
               if(strDias == null) strDias = "";
            %>
              <input type="text" name="dias" Class="form" value="<%=strDias%>" maxlength="5" size="5" onblur="validate(this)"/>dias
            </td>
        </tr>
        
    </table>
    </form>
</DIV>